IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityQueryExtensions Class > FirstOrNullEntity Method : FirstOrNullEntity<TEntity>(IEntityQuery<TEntity>,Expression<Func<TEntity,Boolean>>) Method |
'Declaration
<ExtensionAttribute()> Public Overloads Shared Function FirstOrNullEntity(Of TEntity As Class)( _ ByVal source1 As IEntityQuery(Of TEntity), _ ByVal predicate As Expression(Of Func(Of TEntity,Boolean)) _ ) As TEntity
'Usage
Dim source1 As IEntityQuery(Of TEntity) Dim predicate As Expression(Of Func(Of TEntity,Boolean)) Dim value As TEntity value = EntityQueryExtensions.FirstOrNullEntity(Of TEntity)(source1, predicate)
[Extension()] public static TEntity FirstOrNullEntity<TEntity>( IEntityQuery<TEntity> source1, Expression<Func<TEntity,bool>> predicate ) where TEntity: class
var mgr1 = new DomainModelEntityManager(); Customer cust = mgr1.Customers.FirstOrNullEntity(c => c.Country == "UK");
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2